export const checkCode = (_: any, value: string) => {
  if (!value || value.length !== 4) {
    return Promise.reject(new Error("验证码有误"));
  }
  return Promise.resolve();
};

export const checkUsername = (_: any, value: string) => {
  // console.log(value, !/^\w{2,16}$/.test(value));
  if (!/^\w{2,16}$/.test(value)) {
    return Promise.reject(new Error("用户名至少2~16个字符"));
  }
  return Promise.resolve();
};
